# Demonstrates how to use CSS properties to make a window.
# Also shows how we can make a frameless window (that is without Title Bar)
import sys
from PySide import QtGui, QtCore

class Window(QtGui.QWidget):
    def __init__(self):
        super(Window, self).__init__()

        self.btn = QtGui.QPushButton("Color Dialog", self)
        self.btn.clicked.connect(self.showColorDialog)

        # Draw an initial frame for holding the default color
        col = QtGui.QColor(0, 0, 0)
        self.colorFrame = QtGui.QFrame(self)
        self.colorFrame.setStyleSheet("QWidget {background-color: %s}" % col.name())
        self.colorFrame.setGeometry(130, 22, 100, 100)

		# Need no Title bar
        self.setWindowFlags(QtCore.Qt.FramelessWindowHint)

        self.setGeometry(200, 200, 250, 150)
        self.setWindowTitle("Color dialog")

    def showColorDialog(self):
        print("dialoggggggg")
        col = QtGui.QColorDialog.getColor()
        if col.isValid():
            self.colorFrame.setStyleSheet("QWidget {background-color: %s}" % col.name())

if __name__ == "__main__":
    appObject = QtGui.QApplication(sys.argv)
    ex = Window()
    ex.show()
    sys.exit(appObject.exec_())

